// 找到头文件
#include <csignal>
#include <workflow/WFFacilities.h>
#include <workflow/WFTaskFactory.h>
#include <iostream>

using namespace std;

//定义全局变量
static WFFacilities::WaitGroup waitGroup(1);
 
void signalhandler(int signum){
    waitGroup.done(); //每done一次，等待的n就-1
}

int main(){
    signal(SIGINT, signalhandler);

    WFHttpTask* httpTask = WFTaskFactory::create_http_task(
        "www.baidu.com",
        10, 
        10,
        nullptr
    );//创建一个http客户端任务

    httpTask->start(); //将任务交给框架
    httpTask->start(); 

    waitGroup.wait();
    cout << "finished!\n";

    return 0;
}